package com.ruoyi.common.utils.http;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BigDataResponse<T> implements BaseResponse<BigDataResponse.PageData<T>> {

    private Integer code;
    private String msg;
    private PageData<T> data;  // data字段改为分页数据对象

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public PageData<T> getData() {
        return data;
    }

    @Override
    public boolean isSuccess() {
        return code != null && code == 200; // 根据返回结果，成功状态码为200
    }

    // 分页数据内部类
    @Data
    public static class PageData<T> {
        private Integer totalPage;
        private Integer totalCount;
        private Integer size;
        private Integer currentPage;
        private List<T> dataItems;  // 数据列表
    }
}
